Skip to content

dgb(phase-b): get_height_and_last endpoint window SSOT + KAT - #414

Merged
frstrtr merged 1 commit into
masterfrom
dgb/ghal-endpoints-ssot
Jun 24, 2026
Merged

dgb(phase-b): get_height_and_last endpoint window SSOT + KAT#414
frstrtr merged 1 commit into
masterfrom
dgb/ghal-endpoints-ssot

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 24, 2026

Copy link
Copy Markdown
Owner

DGB Phase-B — get_height_and_last endpoint window SSOT + KAT

Fenced, additive Phase-B pillar (follow-on to #411 tail-score endpoints). Lifts the pure integer window arithmetic that every consumer of forest.get_height_and_last() applies to the resolved (height, last) pair into a header-only SSOT: src/impl/dgb/coin/get_height_and_last_endpoints.hpp.

Lifted guards (oracle-anchored):

  • rooted-tail invariant — height >= REAL_CHAIN_LENGTH or last is None (data.py:160-161)
  • verify entry guard — height >= CHAIN_LENGTH+1 or last is None (data.py:695-696)
  • PPLNS window depth — min(height, REAL_CHAIN_LENGTH) (redistribute.hpp:453)
  • PPLNS window activation — depth >= 1 (redistribute.hpp:454)
  • PPLNS max shares — max(0, min(height, REAL_CHAIN_LENGTH) - 1) (pplns_weight_walk.hpp:96)
  • monitor diagnostic gate — height >= 10 (pool_monitor.hpp:98)

Oracle anchor: p2pool-dgb-scrypt util/forest.py:171-173 (get_height_and_last -> delta.height, delta.tail), data.py:160-161, data.py:695-696, networks/digibyte.py (REAL_CHAIN_LENGTH = 12*60*60//15 = 2880).

No runtime rewire: redistribute.hpp / pool_monitor.hpp / share_check.hpp are NOT rewired this slice — byte-identity delegation is the follow-on. The get_delta_to_last skip-list walk stays in the forest; only the integer guards over the already-resolved pair are lifted.

KAT 7/7 green (non-circular — every expectation re-derived from the oracle min/clamp identities + DGB net constants, including a full 0..2*CHAIN_LENGTH consistency sweep). Per-coin isolation: src/impl/dgb/ only. Test in both build.yml --target arms + dir CMakeLists.txt.

No self-merge — surfacing for tap on full-rollup green.

@frstrtr
frstrtr force-pushed the dgb/ghal-endpoints-ssot branch from 09dab20 to 1c8e8b0 Compare June 24, 2026 09:34
frstrtr added a commit that referenced this pull request Jun 24, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
@frstrtr
frstrtr force-pushed the dgb/ghal-endpoints-ssot branch from 1c8e8b0 to f4d3ee8 Compare June 24, 2026 10:20
frstrtr added a commit that referenced this pull request Jun 24, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
@frstrtr
frstrtr force-pushed the dgb/ghal-endpoints-ssot branch from f4d3ee8 to f3a67ae Compare June 24, 2026 14:45
frstrtr added a commit that referenced this pull request Jun 24, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
@frstrtr
frstrtr force-pushed the dgb/ghal-endpoints-ssot branch from f3a67ae to 20b3a87 Compare June 24, 2026 15:51
frstrtr added a commit that referenced this pull request Jun 24, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
Lift the pure integer window arithmetic that every consumer of
forest.get_height_and_last() applies to the resolved (height, last) pair
into a fenced header-only SSOT, coin/get_height_and_last_endpoints.hpp:

  - rooted-tail invariant   = height >= REAL_CHAIN_LENGTH or last is None
  - verify entry guard      = height >= CHAIN_LENGTH+1 or last is None
  - PPLNS window depth       = min(height, REAL_CHAIN_LENGTH)
  - PPLNS window activation  = depth >= 1
  - PPLNS max shares         = max(0, min(height, REAL_CHAIN_LENGTH) - 1)
  - monitor diagnostic gate  = height >= 10

vs the p2pool-dgb-scrypt oracle: util/forest.py:171-173 (get_height_and_last
-> delta.height, delta.tail), data.py:160-161 (generate_transaction
rooted-tail assert), data.py:695-696 (attempt_verify rooted-tail raise),
networks/digibyte.py REAL_CHAIN_LENGTH = 12*60*60//15 = 2880. The
get_delta_to_last skip-list walk stays in the forest; this slice lifts only
the integer guards over the already-resolved pair, with a non-circular KAT
(7/7) that re-derives every expectation from the oracle min/clamp identities
and DGB net constants, including a full 0..2*CHAIN_LENGTH consistency sweep.

FENCED, additive: redistribute.hpp / pool_monitor.hpp / share_check.hpp NOT
rewired (byte-identity delegation is the follow-on). Per-coin isolation:
src/impl/dgb/ only. Test in both build.yml --target arms + dir CMakeLists.txt.
@frstrtr
frstrtr force-pushed the dgb/ghal-endpoints-ssot branch from 20b3a87 to fda3bcb Compare June 24, 2026 19:18
frstrtr added a commit that referenced this pull request Jun 24, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
@frstrtr
frstrtr merged commit 8bbc54b into master Jun 24, 2026
33 checks passed
frstrtr added a commit that referenced this pull request Jun 24, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
frstrtr added a commit that referenced this pull request Jun 25, 2026
…t SSOT

Rewire refresh_pplns_cache's inline window guard in redistribute.hpp onto
the get_height_and_last_endpoints.hpp SSOT (PR #414):

  depth = std::min(height, real_chain_length())   -> dgb::pplns_window_depth(...)
  if (depth < 1) return;                           -> if (!dgb::pplns_window_active(depth)) return;

Byte-identical: pplns_window_depth is std::min and pplns_window_active is
depth>=1, so !active == depth<1. No reward-distribution value change.

Proof: dgb_redistribute_delegate_ghal_test re-derives the verbatim inline
std::min/(depth<1) directly (non-circular) and asserts the SSOT call
reproduces it across a height matrix straddling negative/0/1/RCL+-1, both
nets. 3/3 green; prod dgb_redistribute_test 8/8 unchanged. FENCED dgb/ only.
Target in CMake + both build.yml allowlist arms.
frstrtr added a commit that referenced this pull request Jun 25, 2026
dgb: delegate redistribute PPLNS-window guard onto get_height_and_last SSOT (#414 follow-on)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant